version: "2.27"

name: weather_api

services:
  frontend:
    container_name: frontend
    restart: always
    build: frontend
    environment:
      - BACKEND_LINK=0.0.0.0:8002
    ports:
      - 8080:8080
    depends_on:
      - backend


  backend:
    container_name: backend
    restart: always
    build: backend
    environment:
      - POSTGRES_WEATHER_NAME_SERVICE=postgres-weather-service
      - POSTGRES_WEATHER_DB=weather-service
      - POSTGRES_USER=postgres
      - POSTGRES_PASSWORD=postgres
    depends_on:
      - postgres-weather-service
    ports:
      - 8002:8000


  postgres-weather-service:
    container_name: postgres-weather-service
    restart: always
    image: postgres:16
    volumes:
      - ./dump/dump_weather.sql:/docker-entrypoint-initdb.d/dump_weather.sql
    environment:
      - POSTGRES_DB=weather-service
      - POSTGRES_HOST_AUTH_METHOD=trust
    # ports:
    #   - 5432:5433
    # command: 
    #   - -p 5433
